home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 814 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: chaos.kulnet.kuleuven.ac.be!usenet
  2. From: loos@claus.esat.kuleuven.ac.be (Bert Loos)
  3. Newsgroups: gnu.gcc.help,comp.unix.programmer,comp.lang.c
  4. Subject: hsearch() in libc.a -- hashtable troubles
  5. Date: 09 Jan 1996 16:41:56 +0100
  6. Organization: K.U.Leuven
  7. Sender: loos@claus.esat.kuleuven.ac.be
  8. Message-ID: <wr3pwctfk8r.fsf@claus.esat.kuleuven.ac.be>
  9. NNTP-Posting-Host: claus.esat.kuleuven.ac.be
  10. X-Newsreader: Gnus v5.1
  11.  
  12.  
  13. I cannot understand this hsearch function. Even when I initialize 
  14. a huge hashtable, hsearch(item,FIND) still bumps on full slots 
  15. with 5-10% of the keys. (I use integers as keys, 0..2^24) 
  16.  
  17. Even worse, hsearch then *overwrites* the previous key value
  18. with the new one! Even with FIND as action, not ENTER!
  19. It should use the next free slot, right?
  20.  
  21. Can anyone enlighten me please?
  22.  
  23. -- 
  24. Bert Loos                     e-mail: loos@esat.kuleuven.ac.be
  25. K.U.Leuven, Dept.Elektrotechniek, ESAT-MI2           Tel: +32-16-321070
  26. Kard.Mercierlaan 94, B-3001 Leuven, BELGIUM            Fax: +32-16-321986
  27. ^^^^^^^^^^^^^^^^ http://www.esat.kuleuven.ac.be/~loos ^^^^^^^^^^^^^^^^^^^
  28. geekcode3.1:  GE d-- s:- a-- C++ UO++ P+ L E+ W+ N++ o? K- w--- O+ !M !V- 
  29. PS+ PE Y+ PGP-- t 5+ X- R- tv(++) b++ !DI D+ G++ e+++(*) h*(--) r-- z-(+)
  30.